package Java攻略._3_流式操作._7_获取元素数量;

import java.util.stream.Collectors;
import java.util.stream.Stream;

public class _40_利用Collectors_counting方法获取元素数量 {

    public static void main(String[] args) {

        Long count = Stream.of(1, 2, 3, 4, 5, 6)
                .collect(Collectors.counting());

        System.out.println(count);
    }
}
